<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <th:block th:include="common/common::common('菜单管理')"/>
    <th:block th:include="common/common::zTree"/>
    <script th:src="@{/static/admin/menu/index.js}" charset="utf-8"></script>
    <style>
        .layui-table-view .layui-form-switch {
            width: 63px;
        }
    </style>
</head>
<body class="bg-color">
<div class="tree-container">
    <div class="tree-box">
        <div class="tree-title">菜单</div>
        <div class="tree-title-line"></div>
        <div id="tree" class="ztree"></div>
    </div>
    <!--右侧内容-->
    <div class=" tree-table-content ">
        <div class="tree-table">
            <!-- 表格 -->
            <div class="layui_table" id="menuTableBox">
                <table class="layui-hide" id="layTable" lay-filter="layFilter"></table>
            </div>
            <div class="layui_table" id="elementTableBox" style="display: none">
                <table class="layui-hide" id="layElementTable" lay-filter="layElementFilter"></table>
            </div>
        </div>
    </div>
</div>

<!-- 表头工具栏 -->
<script type="text/html" id="toolbar">
    <div class="tool-head-bar">
        <div class="head-search" sec:authorize="hasAuthority('admin:menu:info:query')">
            <input class="layui-input float_left" placeholder="标题"
                   id="title" name="title" autocomplete="off">
            <button class="layui-btn layui-btn-sm layui-btn-normal search-btn float_left"
                    lay-event="search">
                <i class="layui-icon layui-icon-search"></i>搜索
            </button>
        </div>
        <button sec:authorize="hasAuthority('admin:menu:info:save')"
                class="layui-btn layui-btn-sm layui-btn-normal add-btn"
                lay-event="saveMenuInfo" id="headBarTool">
            <i class="layui-icon"></i>新增
        </button>
    </div>
</script>

<!-- 操作工具栏 -->
<script type="text/html" id="toolbarHandle">
    <button sec:authorize="hasAuthority('admin:menu:info:update')"
            class="tool-bar-btn edit-button" lay-event="update">
        <i class="layui-icon layui-icon-edit"></i>编辑
    </button>
    <button sec:authorize="hasAuthority('admin:menu:info:delete')"
            class="tool-bar-btn remove-button" lay-event="delete">
        <i class="layui-icon layui-icon-delete"></i>删除
    </button>
</script>

<script type="text/html" id="toolbarElement">
    <div class="tool-head-bar">
        <div class="head-search" sec:authorize="hasAuthority('admin:element:info:query')">
            <input class="layui-input float_left" placeholder="资源名称"
                   id="elementTitle" name="elementTitle" autocomplete="off">
            <button class="layui-btn layui-btn-sm layui-btn-normal search-btn float_left"
                    lay-event="search">
                <i class="layui-icon layui-icon-search"></i>搜索
            </button>
        </div>
        <!--  -->
        <button sec:authorize="hasAuthority('admin:element:info:save')"
                class="layui-btn layui-btn-sm layui-btn-normal add-btn"
                lay-event="saveElement">
            <i class="layui-icon"></i>新增
        </button>
    </div>
</script>

<!-- 操作工具栏 -->
<script type="text/html" id="toolbarElementHandle">
<!--    <button sec:authorize="hasAuthority('admin:element:info:view')"-->
<!--            class="tool-bar-btn see-button" lay-event="view">-->
<!--        <i class="layui-icon layui-icon-list"></i>查看-->
<!--    </button>-->
    <button sec:authorize="hasAuthority('admin:element:info:update')"
            class="tool-bar-btn edit-button" lay-event="update">
        <i class="layui-icon layui-icon-edit"></i>编辑
    </button>
    <button sec:authorize="hasAuthority('admin:element:info:delete')"
            class="tool-bar-btn remove-button" lay-event="delete">
        <i class="layui-icon layui-icon-delete"></i>删除
    </button>
</script>

<script type="text/html" id="menuVisibleTpl">
    <input type="checkbox" name="visible" value="{{d.id}}" lay-skin="switch" lay-text="显示|不显示"
           lay-filter="menuVisibleFilter" {{ d.visible== 1 ? 'checked' : '' }}>
</script>

<script type="text/html" id="elementVisibleTpl">
    <input type="checkbox" name="visible" value="{{d.id}}" title="显示" lay-filter="elementVisibleFilter" {{ d.visible==
           1 ? 'checked' : '' }}>
</script>


</body>
</html>